from django.db import models
from datetime import datetime
# Create your models here.

class SmsRequestData(models.Model):

    id = models.AutoField(verbose_name='id', primary_key=True)
    sign_name = models.CharField(verbose_name='短信签名',default='',null=False,max_length=20)
    phone_numbers = models.CharField(verbose_name='手机号',default='',null=False,max_length=140000)
    template_code = models.CharField(verbose_name='模板code',default='',null=False,max_length=20)
    template_type = models.CharField(verbose_name='模板变量',default='',null=False,max_length=100)
    out_id = models.CharField(verbose_name='外部流水扩展字段',default='',null=True,max_length=50)

    class Meta:
        verbose_name = '短信操作'
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.id)

class RestMessage(models.Model):
    id = models.AutoField(verbose_name='id', primary_key=True)
    app_from = models.CharField(verbose_name='应用来源',default='',null=False,max_length=20)
    token = models.CharField(verbose_name='令牌',default='',null=False,max_length=500)
    create_time = models.DateTimeField(default=datetime.now, verbose_name='创建时间')

    class Meta:
        verbose_name = '接口令牌管理'
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.id)